<!doctype html>
<html xmlns:th = "http://www.thymeleaf.org">
<head th:replace="layouts::header"></head>

<body>
    <nav th:replace="layouts::navbar"></nav>
    <div class="distance">
    <h3>主面板</h3>
    <hr>
    <h4>当前项目</h4>
    <div class="row">
        <div class="col-md-6">
            <table class="table table-bordered table-striped">
                <thead class="thead-dark">
                <tr>
                    <th>项目名称</th>
                    <th>项目状态</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="aBorrow:${borrows}">
                    <td th:text="${aBorrow.name}"></td>
                    <td th:text="${aBorrow.stage}"></td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="col-md-4">
            <canvas id="myPieChart" height="50" width="50"></canvas>
            <script>
                let chartData = "[[${projectStatusData}]]"
            </script>
        </div>
    </div>
    </div>

    <div class="distance">
        <h4>当前学生</h4>
        <div class="row">
            <div class="col-md-6">
                <table class="table table-bordered table-striped">
                    <thead class="thead-dark">
                    <tr>
                        <th>学生姓名</th>
                        <th>微信号</th>
                        <th>项目个数</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="aBook:${bookBorrows}">
                        <td th:text="${aBook.name}"> </td>
                        <td th:text="${aBook.numberId}"> </td>
                        <td th:text="${aBook.borrowCount}"> </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <script type="text/javascript" th:src="@{css/js/myChart.js}"></script>
    </div>
</div>
</body>
</html>